# -*- coding: utf-8 -*-
"""
file:ch4_1微分非连续函数
author: Fuwen
time: 2022/7/16 9:37
software:PyCharm
"""
import matplotlib.pyplot as plt
import numpy as np

# 非连续函数，f(x) = 1 / x, x!=0
# 0的去心邻域

# (-oo, 0) 左侧图形, 当x值越小时， 图形越趋近于直角边
x_l = np.linspace(-10, -0.01, 100)
y_l = [1/x for x in x_l]
plt.plot(x_l, y_l)

# (0, +oo) 右侧图形
x_r = np.linspace(0.01, 10, 100)
y_r = [1/x for x in x_r]
plt.plot(x_r, y_r)

plt.axis([-10, 10, -100, 100])
plt.grid()
plt.show()